<?php
//调用
require_once 'wish.php';

$id = $_SESSION['id'];
//查询
$sql = "SELECT * FROM `wish` WHERE `id` = $id";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    //echo "登录成功";
    //找到这个ID是什么
    $res = $result->fetch_assoc();
    $name = $res["name"];
    $content = $res["content"];
    $password = $res["password"];
    //把ID存到session
    $_SESSION['content']=$content;
    $_SESSION['name'] = $name;
    $_SESSION['password']=$password;

   
} else {

}
?>
<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="dier.css">
</head>

<body>
    <div class="index">
    <p class="toer">编辑我的许愿</p>
        <form action="bjcg.php" method="get">
            <div class=" write">
                <div class="name">
                    <p>我的名字：</p>
                    <input type="text" name="name" value="<?php echo $_SESSION['name']; ?>">
                </div>

                <span class="sp">贴纸颜色:</span>
                    <input type="radio" name="color" value="#a6f88c">绿色
                    <input type="radio" name="color" value="#a6e2fc">蓝色
                    <input type="radio" name="color" value="#fdfb8c">黄色
                    <input type="radio" name="color" value="#fdc4f1">粉色
              
                <div class="text">
                <p><span class="tex">我的愿望</span></p>
                    <textarea name="content" cols="30" rows="10" placeholder="<?php echo $_SESSION['content']; ?>"></textarea>
                </div>
                <div class="zuixia">
                    <p>保护密码：<input class="pass" type="password" name="password" value="<?php echo $_SESSION['password']; ?>"><input type="submit" value="更改">
                        <a href="index.php" class="qx">取消</a></p>

                </div>
            </div>
        </form>
    </div>
</body>

</html>